<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .pp{
            width: 200px;
            height: 200px;
            background-color: yellowgreen;
            margin: 10px;
        }
    </style>
</head>
<body>
    
</body>
<script>
    var str = "";
   
    for(var i=0;i<10;i++){
        // str = str + "<div class='pp'>666</div>";
        // str += "<div class='pp'>"+i+"</div>";
        // 新语法
        str +=  `<div class='pp'>${i}</div>`;
    }
    
    

    document.body.innerHTML = str;

</script>
</html>